﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EditUsers_Poor
{
    public partial class MainForm : Form
    {
        private ManageUsersView manageUsersView;

        public MainForm()
        {
            InitializeComponent();
            manageUsersView = new ManageUsersView();

            // Add some test data
            manageUsersView.usersDataSet.User.AddUserRow("awigley", "Andy", "Wigley");
            manageUsersView.usersDataSet.User.AddUserRow("pfoot", "Peter", "Foot");
            manageUsersView.usersDataSet.User.AddUserRow("aradinger", "Andrej", "Radinger");
            manageUsersView.usersDataSet.User.AddUserRow("pvickers", "Pete", "Vickers");
        }

        private void menuItemExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
        }

        private void listViewOptions_ItemActivate(object sender, EventArgs e)
        {
            // Activate the requested option
            if (listViewOptions.SelectedIndices[0] == 0)
            {
                    manageUsersView.ShowDialog();
            }
        }

    }
}